//
//  MainDataBase.h
//  Conference
//
//  Created by 陈鑫 on 12-11-16.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
@class PlaceData;
@class AlarmData;
@class Member;
@class ScheduleData;
@class NewsData;
@class AttachData;
@class EleSpeakData;
@class FlightData;
@interface MainDataBase : NSObject{
    NSString *DataBaseName;
    
    NSString *tabConfearencesAlarm;
    NSString *tabConfearencesSchedule;
    NSString *tabNews;
    NSString *tabEleSpeak;
    NSString *tabFlight;
    NSString *tabUser;
    NSString *tabPlace;
    
    NSString *TAB_CONFERENCESALARM;
    NSString *TAB_CONFERENCESSCHEDULE;
    NSString *TAB_NEWS;
    NSString *TAB_ELESPEAK;
    NSString *TAB_FLIGHT;
    NSString *TAB_USER;
    NSString *TAB_PLACE;
    NSString *TAB_ATTACHINFO;
}
@property(nonatomic,retain) FMDatabase *db;
+(MainDataBase *)getInstance;

-(BOOL)addAlarms:(NSMutableArray *)message;
-(int)addAlarmsSingle:(AlarmData *)alarmData;
-(BOOL)delAlarmsByDate:(NSString *)date;
-(BOOL)delAlarmsByMemberID;
-(BOOL)clearAlarms;
-(NSMutableArray*)getAlarms;
-(NSMutableArray*)getAlarmsGroup;
-(NSMutableArray*)getAlarmsByDate:(NSString *)sDate;


-(BOOL)addSchedule:(NSMutableArray *)scheduleDataList;
-(int)addScheduleData:(ScheduleData*)scheduleData;
-(BOOL)updateByScheduleId:(NSMutableArray *)scheduleDataList;
-(void)updateScheduleData:(ScheduleData *)scheduleData;
-(BOOL)delScheduleByConferenceID;
-(BOOL)clearSchedule;
-(NSMutableArray*)getScheduleData;


-(BOOL)addNews:(NSMutableArray*)newsDataList;
-(int)addNewsData:(NewsData *)newsData;
-(BOOL)updateNews:(NSMutableArray*)updateNews;
-(void)updateNewsData:(NewsData *)newsData;
-(void)delNewsById:(NSString *)newsID;
-(BOOL)delNewsByConferenceID;
-(BOOL)clearNews;
-(NSMutableArray*)getNewsDatas;


-(BOOL)addAttachInfo:(NSMutableArray*)attachDataList;
-(void)addAttach:(AttachData *)attachData;
-(BOOL)updateAttachInfo:(AttachData *)attachData attachID:(int)attachID;
-(BOOL)delAttachInfoByAttachId:(int)attchID;
-(BOOL)clearAttach;
-(NSMutableArray*)getAttachData:(int)typeID type:(NSString *)type;

-(BOOL)addEleSpeak:(NSMutableArray*)eleSpeakDataList;
-(int)addSpeakData:(EleSpeakData*)eleSpeakData;
-(BOOL)updateEleSpeak:(NSMutableArray*)eleSpeakDataList;
-(void)updateSpeakData:(EleSpeakData *)eleSpeakData;
-(BOOL)delEleSpeakByID:(NSString *)eleSpeakId;
-(BOOL)clearEleSpeak;
-(NSMutableArray*)getEleSpeakData;


-(BOOL)addFlight:(NSMutableArray *)flightDataList;
-(int)addFlightData:(FlightData *)flightData;
-(BOOL)updateFlight:(NSMutableArray *)flightDataList;
-(BOOL)updateFlightById:(NSString*)id type:(NSString*)type;
-(BOOL)delFlightById:(NSString *)Id type:(NSString *)type;
-(BOOL)clearFlight;
-(NSMutableArray*)getFlight:(NSString*)type;


-(NSMutableArray*)getUserName;
-(Member*)getAutoMember;
-(NSInteger)addUser:(Member*)member;
-(BOOL)DelUser:(Member*)member;
//-(BOOL)UpdateUser:(Member*)member;
-(BOOL)setUser;
-(BOOL)UpDateUserTimer:(int)memberId;
-(NSMutableArray*)getPlaceData;
-(BOOL)addPlace:(NSMutableArray*)placeDataList;
-(void)addPlaceData:(PlaceData *)placeData;
-(BOOL)delPlaceData:(NSString*)placeID;


@end
